package com.settlement.system.model.entity.common;

import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.write.style.ColumnWidth;
import com.alibaba.excel.annotation.write.style.HeadFontStyle;
import com.alibaba.excel.annotation.write.style.HeadRowHeight;
import com.alibaba.excel.annotation.write.style.HeadStyle;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.settlement.system.converter.BigNumberFormatConvert;
import com.settlement.system.converter.BillCategoryConvert;
import com.settlement.system.converter.DateFormatConvert;
import io.swagger.annotations.ApiModelProperty;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Pattern;
import lombok.Data;
import org.hibernate.validator.constraints.NotBlank;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;

/**
 * RR-日记账-余额监控
 * @author Ximi
 * @since 2020-11-17
 */
@Data
@ExcelIgnoreUnannotated
@HeadStyle(fillBackgroundColor = 9,fillForegroundColor = 9)
@HeadRowHeight(value = 20)
@HeadFontStyle(fontHeightInPoints = 14)
public class TblBalanceWatcher extends BaseModel implements Serializable {

    /**
     * 账单大类
     */
    @ColumnWidth(13)
    @ExcelProperty(value = "账单大类",converter = BillCategoryConvert.class)
    @ApiModelProperty(value = "账单大类（1、平台账单，2、营销工具，3、手工调账）")
    @NotNull(message="账单大类不能为空")
    @Pattern(regexp="^[1-3]{1}$",message="[账单大类]只能为\"平台账单\"、\"营销工具\"或\"手工调账\"")
    private String billCategory;

    /**
     * 渠道名称
     */
    @ExcelProperty(value = "渠道")
    @ApiModelProperty(value = "渠道")
    @NotBlank(message="渠道不能为空")
    private String channelName;

    /**
     * 渠道编码
     */
    @ExcelProperty(value = "渠道编码")
    @ApiModelProperty(value = "渠道编码")
    private String channelNo;

    /**
     * NC店铺编码
     */
    @ExcelProperty(value = "NC店铺编码",converter = BigNumberFormatConvert.class)
    @ApiModelProperty(value = "NC店铺编码")
    private String ncShopNo;

    /**
     * 零售店铺编码
     */
    @ExcelProperty(value = "零售店铺编码")
    @ApiModelProperty(value = "零售店铺编码")
    private String shopNo;

    /**
     * NC店铺名称
     */
    @ExcelProperty(value = "NC店铺名称")
    @ApiModelProperty(value = "NC店铺名称")
    private String ncShopName;

    /**
     * 零售店铺名称
     */
    @ExcelProperty(value = "零售店铺名称")
    @ApiModelProperty(value = "零售店铺名称")
    private String shopName;

    /**
     * 账号 - 值改为店铺账号的，先不改字段的拼写
     */
    @ExcelProperty(value = "账号")
    @ApiModelProperty(value = "账号")
    private String loginAccount;

    /**
     * 日期
     */
    @ExcelProperty(value = "日期",converter = DateFormatConvert.class)
    @ApiModelProperty(value = "日期")
    @NotNull(message="日期不能为空")
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    private Date outDate;

    /**
     * 期初余额
     */
    @ExcelProperty(value = "期初余额")
    @ApiModelProperty(value = "期初余额")
    private BigDecimal startAmount;

    /**
     * 统一账单发生额
     */
    @ExcelProperty(value = "统一账单发生额")
    @ApiModelProperty(value = "统一账单发生额")
    private BigDecimal happenAmount;

    /**
     * 期末余额
     */
    @ExcelProperty(value = "期末余额")
    @ApiModelProperty(value = "期末余额")
    @NotNull(message="期末余额不能为空")
    private BigDecimal endAmount;

    /**
     * 账户余额
     */
    @ExcelProperty(value = "账户余额")
    @ApiModelProperty(value = "账户余额")
    @NotNull(message="账户余额不能为空")
    private BigDecimal accountAmount;

    /**
     * 差异
     */
    @ExcelProperty(value = "差异")
    @ApiModelProperty(value = "差异")
    private BigDecimal difAmount;

    /**
     * 原始账单条数
     */
    @ExcelProperty(value = "原始账单条数")
    @ApiModelProperty(value = "原始账单条数")
    private Integer originBillCount;

    /**
     * 统一账单条数
     */
    @ExcelProperty(value = "统一账单条数")
    @ApiModelProperty(value = "统一账单条数")
    private Integer unificationBillCount;

    /**
     * 是否为第一条
     */
    @ExcelProperty(value = "是否为第一条")
    @ApiModelProperty(value = "是否为第一条")
    private String isStartItem;



}
